package com.sx.dao.user;

import com.sx.basic.dao.BasicRepository;
import com.sx.entity.user.UserEntity;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author AdinZ
 * @date 2020/11/10 17:27
 */
@Repository
public interface UserRepository extends BasicRepository<UserEntity,Long> {
    /**
     * 更新用户状态
     * @param ids
     * @param state
     * @return
     */
    @Modifying
    @Query("update UserEntity e set e.state=?2 where e.id in ?1")
    Integer updateState(Long[] ids, int state);
}
